/*
 *  fix.h
 *  EPPI-0.0
 *
 *  Created by Juan Carlos Garcia Orden on 26/08/2011
 *
 */

#ifndef _fix_h_
#define _fix_h_

#include "constraint.h"
#include "commonutil.h"


using namespace std;

class Fix : public Constraint
{
public:
	VectorXd fixedP;
	double endTime;
	vector <double> c;
	int fixedofNumber;
	
public:
	Fix();
	Fix(vector<string>&, int, int, double);
	Fix(vector<string>&, int, int, double, double);
	~Fix(){}

	// Virtual functions from base
	/*
	void calcPhi(const vector<double>&);
	void calcDPhi(const vector<double>&);
	void calcDDPhi(const vector<double>&);
	void setFqSymmetries();
	void setKqSymmetries();
	 */
	
	void calcPhi(const VectorXd &);
	void calcDPhi(const VectorXd &);
	void calcDDPhi(const VectorXd &);
	void setFqSymmetries();
	void setKqSymmetries();
	
	/** Local functions */
	void fillFixedP();

	/** Friend functions */
	friend double lTwoNorm(const vector<double>& v1);
	friend double lTwoNorm(const vector<double>& v1, const vector<double>& v2);
	friend void uVersor(const vector<double>& v1, const double & dis, const int& dim, vector<double>& u);
//	friend void uVersor(const vector<double>& v1, const vector<double>& v2, const double & dis, vector<double>& u);
	friend void printSTLVector(vector<double>& v);
	friend void printSTLMatrix(const vector< vector<double> >& m);


};

#endif

